/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * AddSpecialPanel.java
 *
 * Created on Nov 2, 2011, 1:42:35 PM
 */
package drinkkiosk.drinks;

import javax.swing.JComboBox;
import javax.swing.JDialog;
import javax.swing.JTextField;

/**AddSpecialPanel is a JPanel with multiple ComboBoxes for adding a SpecialDrink.
 * As the Staff chooses from the drop-down menus, the SpecialDrink object is
 * updated.
 * @author Charles Ritchea
 */
public class AddSpecialPanel extends javax.swing.JPanel {
	/**The Special Drink*/
	private SpecialDrink drink;
	/**Drink Getter
	 * @return Drink
	 */
	public Drink getDrink() {
		return drink;
	}
	/**AddSpecialPanel creates a new Drink with empty fields
	 */
	public AddSpecialPanel() {
		drink = new SpecialDrink("","","","","","","","");
		initComponents();
	}

	/** This method is called from within the constructor to
	 * initialize the form.
	 * WARNING: Do NOT modify this code. The content of this method is
	 * always regenerated by the Form Editor.
	 */
	@SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        LiquorComboBox = new javax.swing.JComboBox();
        jLabel1 = new javax.swing.JLabel();
        LiqueurComboBox = new javax.swing.JComboBox();
        jLabel2 = new javax.swing.JLabel();
        NonAlcoholicComboBox = new javax.swing.JComboBox();
        jLabel3 = new javax.swing.JLabel();
        GarnishComboBox = new javax.swing.JComboBox();
        jLabel4 = new javax.swing.JLabel();
        BarwareComboBox = new javax.swing.JComboBox();
        jLabel5 = new javax.swing.JLabel();
        TemperatureComboBox = new javax.swing.JComboBox();
        jLabel6 = new javax.swing.JLabel();
        jLabel7 = new javax.swing.JLabel();
        NameTextField = new javax.swing.JTextField();
        jLabel8 = new javax.swing.JLabel();
        AddButton = new javax.swing.JButton();
        jScrollPane1 = new javax.swing.JScrollPane();
        jTextArea1 = new javax.swing.JTextArea();
        jLabel9 = new javax.swing.JLabel();

        setBackground(new java.awt.Color(255, 255, 255));

        LiquorComboBox.setFont(new java.awt.Font("Arial", 0, 24));
        LiquorComboBox.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "None", "Vodka", "Gin", "Light Rum", "Tequila", "Bourbon", "Whiskey", "Scotch", "Spiced Rum", "Black Rum", "Brandy", "Cognac" }));
        LiquorComboBox.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                LiquorComboBoxActionPerformed(evt);
            }
        });

        jLabel1.setFont(new java.awt.Font("Arial", 0, 24));
        jLabel1.setText("Liquor");

        LiqueurComboBox.setFont(new java.awt.Font("Arial", 0, 24));
        LiqueurComboBox.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "None", "Triple-sec", "Sweet Vermouth", "Dry Vermouth", "Blue Curacao", "Peach", "Apple", "Peppermint", "Amaretto", "Hazelnut", "Irish Cream", "Kahlua", "Galliano", " " }));
        LiqueurComboBox.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                LiqueurComboBoxActionPerformed(evt);
            }
        });

        jLabel2.setFont(new java.awt.Font("Arial", 0, 24));
        jLabel2.setText("Liqueuer");

        NonAlcoholicComboBox.setFont(new java.awt.Font("Arial", 0, 24));
        NonAlcoholicComboBox.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "None", "Cold Water", "Hot Water", "Cola", "Seltzer", "Tonic", "Lemonade", "Lemon-lime", "Milk", "Eggnog", "Redbull", "Orange Juice", "Pineapple Juice", "Tea", "Coffee", "Tomato Juice", "Clamato", "Sourmix", " " }));
        NonAlcoholicComboBox.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                NonAlcoholicComboBoxActionPerformed(evt);
            }
        });

        jLabel3.setFont(new java.awt.Font("Arial", 0, 24));
        jLabel3.setText("Non-Alcoholic");

        GarnishComboBox.setFont(new java.awt.Font("Arial", 0, 24));
        GarnishComboBox.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "None", "Olive", "Pearl Onion", "Lemon", "Lime", "Orange", "Cherry", "Celery", "Salt", "Nutmeg" }));
        GarnishComboBox.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                GarnishComboBoxActionPerformed(evt);
            }
        });

        jLabel4.setFont(new java.awt.Font("Arial", 0, 24));
        jLabel4.setText("Garnish");

        BarwareComboBox.setFont(new java.awt.Font("Arial", 0, 24));
        BarwareComboBox.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Old Fashioned", "Chimney", "Martini", "Shot", "Mug", "Skull" }));
        BarwareComboBox.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                BarwareComboBoxActionPerformed(evt);
            }
        });

        jLabel5.setFont(new java.awt.Font("Arial", 0, 24));
        jLabel5.setText("Barware");

        TemperatureComboBox.setFont(new java.awt.Font("Arial", 0, 24));
        TemperatureComboBox.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Room", "Iced", "Frozen", "Hot" }));
        TemperatureComboBox.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                TemperatureComboBoxActionPerformed(evt);
            }
        });

        jLabel6.setFont(new java.awt.Font("Arial", 0, 24));
        jLabel6.setText("Temperature");

        jLabel7.setFont(new java.awt.Font("Arial", 0, 24));
        jLabel7.setText("Name");

        NameTextField.setFont(new java.awt.Font("Arial", 0, 24));
        NameTextField.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                NameTextFieldActionPerformed(evt);
            }
        });

        jLabel8.setFont(new java.awt.Font("Arial", 0, 24));
        jLabel8.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabel8.setText("Add a Special");

        AddButton.setFont(new java.awt.Font("Arial", 0, 24));
        AddButton.setText("Add Special");
        AddButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                AddButtonActionPerformed(evt);
            }
        });

        jTextArea1.setColumns(20);
        jTextArea1.setRows(5);
        jScrollPane1.setViewportView(jTextArea1);

        jLabel9.setFont(new java.awt.Font("Arial", 0, 24));
        jLabel9.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabel9.setText("Description");

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel8, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 719, Short.MAX_VALUE)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addGroup(layout.createSequentialGroup()
                                        .addGap(1, 1, 1)
                                        .addComponent(jLabel6))
                                    .addComponent(jLabel7))
                                .addGap(28, 28, 28)
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(TemperatureComboBox, 0, 269, Short.MAX_VALUE)
                                    .addComponent(NameTextField, javax.swing.GroupLayout.DEFAULT_SIZE, 269, Short.MAX_VALUE)
                                    .addComponent(AddButton, javax.swing.GroupLayout.Alignment.TRAILING)))
                            .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 148, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(jLabel4)
                                    .addComponent(jLabel5))
                                .addGap(18, 18, 18)
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(BarwareComboBox, 0, 269, Short.MAX_VALUE)
                                    .addComponent(GarnishComboBox, 0, 269, Short.MAX_VALUE)
                                    .addComponent(NonAlcoholicComboBox, 0, 269, Short.MAX_VALUE)))
                            .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                                .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()
                                    .addComponent(jLabel2)
                                    .addGap(72, 72, 72)
                                    .addComponent(LiqueurComboBox, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                                .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()
                                    .addComponent(jLabel1)
                                    .addGap(99, 99, 99)
                                    .addComponent(LiquorComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, 269, javax.swing.GroupLayout.PREFERRED_SIZE))))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(jLabel9, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 262, Short.MAX_VALUE))
                        .addGap(10, 10, 10)))
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel8)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(LiquorComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, 31, Short.MAX_VALUE)
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(jLabel1)
                        .addComponent(jLabel9)))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(LiqueurComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, 31, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel2))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel3)
                            .addComponent(NonAlcoholicComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, 31, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(GarnishComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, 31, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel4))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(BarwareComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, 31, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel5))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(TemperatureComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, 31, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel6))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel7)
                            .addComponent(NameTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 29, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(AddButton, javax.swing.GroupLayout.PREFERRED_SIZE, 42, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 214, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(38, 38, 38))
        );
    }// </editor-fold>//GEN-END:initComponents
	/**When the Staff changes LiquorComboBox the Drink is changed to match
	 * @param evt ActionEvent the event of LiquorComboBox being changed 
	 */
	private void LiquorComboBoxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_LiquorComboBoxActionPerformed
		JComboBox comboBox = (JComboBox)evt.getSource();
		drink.setLiquor(comboBox.getSelectedItem().toString());
	}//GEN-LAST:event_LiquorComboBoxActionPerformed
	/**When the Staff changes LiqueurComboBox the Drink is changed to match
	 * @param evt ActionEvent the event of LiqueurComboBox being changed 
	 */
	private void LiqueurComboBoxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_LiqueurComboBoxActionPerformed
		JComboBox comboBox = (JComboBox)evt.getSource();
		drink.setLiqueur(comboBox.getSelectedItem().toString());
	}//GEN-LAST:event_LiqueurComboBoxActionPerformed
	/**When the Staff changes NonAlcoholicComboBox the Drink is changed to match
	 * @param evt ActionEvent the event of NonAlcoholicComboBox being changed 
	 */
	private void NonAlcoholicComboBoxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_NonAlcoholicComboBoxActionPerformed
		JComboBox comboBox = (JComboBox)evt.getSource();
		drink.setNonalcoholic(comboBox.getSelectedItem().toString());
	}//GEN-LAST:event_NonAlcoholicComboBoxActionPerformed
	/**When the Staff changes GarnishComboBox the Drink is changed to match
	 * @param evt ActionEvent the event of GarnishComboBox being changed 
	 */
	private void GarnishComboBoxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_GarnishComboBoxActionPerformed
		JComboBox comboBox = (JComboBox)evt.getSource();
		drink.setGarnish(comboBox.getSelectedItem().toString());
	}//GEN-LAST:event_GarnishComboBoxActionPerformed
	/**When the Staff changes BarwareComboBox the Drink is changed to match
	 * @param evt ActionEvent the event of BarwareComboBox being changed 
	 */
	private void BarwareComboBoxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_BarwareComboBoxActionPerformed
		JComboBox comboBox = (JComboBox)evt.getSource();
		drink.setBarware(comboBox.getSelectedItem().toString());
	}//GEN-LAST:event_BarwareComboBoxActionPerformed
	/**When the Staff changes TemperatureComboBox the Drink is changed to match
	 * @param evt ActionEvent the event of TemperatureComboBox being changed 
	 */
	private void TemperatureComboBoxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_TemperatureComboBoxActionPerformed
		JComboBox comboBox = (JComboBox)evt.getSource();
		drink.setTemperature(comboBox.getSelectedItem().toString());
	}//GEN-LAST:event_TemperatureComboBoxActionPerformed
	/**When the Staff changes NameTextField the Drink is changed to match
	 * @param evt ActionEvent the event of NameTextField being changed 
	 */
	private void NameTextFieldActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_NameTextFieldActionPerformed
		JTextField textField = (JTextField)evt.getSource();
		drink.setName(textField.getText());
	}//GEN-LAST:event_NameTextFieldActionPerformed
	/**The SpecialDrink is added to the SpecialsList
	 * @param evt ActionEvent the event of AddButton being pressed 
	 */
	private void AddButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_AddButtonActionPerformed
		drink = new SpecialDrink(NameTextField.getText(),jTextArea1.getText(),LiquorComboBox.getSelectedItem().toString(), LiqueurComboBox.getSelectedItem().toString(), NonAlcoholicComboBox.getSelectedItem().toString(), GarnishComboBox.getSelectedItem().toString(), TemperatureComboBox.getSelectedItem().toString(), BarwareComboBox.getSelectedItem().toString()); 
		DrinkDatabase db = new DrinkDatabase();
		db.loadSpecialsList();
		db.getSpecialsList().add(drink);
		db.saveSpecialsList();
		this.add(new JDialog());
	}//GEN-LAST:event_AddButtonActionPerformed

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton AddButton;
    private javax.swing.JComboBox BarwareComboBox;
    private javax.swing.JComboBox GarnishComboBox;
    private javax.swing.JComboBox LiqueurComboBox;
    private javax.swing.JComboBox LiquorComboBox;
    private javax.swing.JTextField NameTextField;
    private javax.swing.JComboBox NonAlcoholicComboBox;
    private javax.swing.JComboBox TemperatureComboBox;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JLabel jLabel9;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JTextArea jTextArea1;
    // End of variables declaration//GEN-END:variables
}
